import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../views/index.vue'
import City from '../views/city.vue'
import Movie from '../views/movie/movie.vue'
import Theater from '../views/theater/theater.vue'
import Profile from '../views/profile/profile.vue'
import Hotshowing from 'views/movie/components/hotshowing.vue'
import Comingsoon from 'views/movie/components/comingsoon.vue'
import Search from 'views/search.vue'


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: "/index/movie/hotshowing"
  },
  {
    path: '/index',
    component: Index,
    meta: {
      sort: 1
    },
    children: [
      {
        path: "/index/movie",
        component: Movie,
        redirect: "/index/movie/hotshowing",
        meta: {
          sort: 2
        },
        children: [
          {
            path: "hotshowing",///index/movie/hotshowing
            component: Hotshowing,
            meta: {
              sort: 3
            }
          },
          {
            path: "comingsoon",
            component: Comingsoon,
            meta: {
              sort: 4
            }
          },

        ]
      }, {
        path: "/index/theater",
        component: Theater,
        meta: {
          sort: 5
        }
      },
      {
        path: "/index/profile",
        component: Profile,
        meta: {
          sort: 6
        }
      }
    ]
  },
  {
    path: '/city',
    component: City
  },
  {
    path: '/search',
    component: Search
  }
]

const router = new VueRouter({
  routes
})

export default router
